* FILE NAME : CASH407.PRG
*
STORE 0 TO CNT,CR
DO WHILE nmdoct=SPACE(12)
   STORE 0 TO CNT,CR
   SELE 5
   SET EXCLU OFF
   use &dr&f5
   GO TOP
   do while .not. eof()
      IF doct_auth1=keye .or. doct_auth2=keye .or. doct_auth3=keye .or. doct_auth4=keye .or. doct_auth5=keye
         CNT=CNT+1
      ENDIF
      skip
   ENDDO
   DECLARE FLD[CNT]
   DECLARE KDD[CNT]
   DECLARE NMD[CNT]
   SELE 5
   GO TOP
   do while .NOT. EOF()
      IF doct_auth1=keye .or. doct_auth2=keye .or. doct_auth3=keye .or. doct_auth4=keye .or. doct_auth5=keye
         CR=CR+1
         NMD[CR]=DOC_ALIAS
         FLD[CR]=DOC_CODE+' '+ALLTRIM(DOC_ALIAS)
         KDD[CR]=DOC_CODE
      ENDIF
      SKIP
   ENDDO
   set colo to gr+/rb,gr+/r
   @ 17,31 clea to 21,50
   @ 17,31 to 21,50 double
   pilih=achoice(18,33,20,48,FLD)
   IF LASTKEY()=13
      @ 17,31 CLEAR TO 21,50
      NMDOCT=NMD[PILIH]
      FILD=FLD[PILIH]
      DOCT=KDD[PILIH]
   ELSE
      NMDOCT=SPACE(12)
   ENDIF
endDO
